package com.ruoyi.system.domain.vo;

import com.fasterxml.jackson.annotation.JsonFormat;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;

import java.util.Calendar;
import java.util.Date;

/**
 * @program: zhihiwuye
 * @author: fcs
 * @data: 2024-03-12 17:55
 * @description: TODO
 */
@Data
@AllArgsConstructor
@NoArgsConstructor
public class ShopFeeVo {

    //收费项名称
    private String name;

    //起收日期
    @JsonFormat(pattern = "yyyy-MM-dd")
    private Date starttime;

    //到期日期
    @JsonFormat(pattern = "yyyy-MM-dd")
    private Date endtime;

    //费用周期
    private  int period;

    //缴费限期
    @JsonFormat(pattern = "yyyy-MM-dd")
    private Date paymentDate;

    public Date getPaymentDate() {
        Calendar calendar = Calendar.getInstance();
        calendar.setTime(endtime);
        calendar.add(Calendar.DAY_OF_MONTH, 3); // 在当前日期上增加3天
        Date limitDate = calendar.getTime();
        return limitDate;
    }

    //单价
    private double price;

    //数量
    private String num_type;

    //金额
    private double totalPrice;

    public double getTotalPrice() {
        return price * 1.5;
    }
}
